<?php
namespace App\Models;
use Illuminate\Support\Facades\DB;

class ShopOrderAppraise extends CommonModel {
	protected $table = 'shop_order_appraise';
	//获取店铺当前评分
    public function getSoreNum($store_id){
       $score = number_format(ShopOrderAppraise::select(DB::raw('sum(`score`)/count(*) as score'))->where('store_id',$store_id)->value('score'),1);
       return $score?:0;
    }
}